/**
 * 作者: wgx
 * 日期: 2025-06-17 10:52:13
 * 备注: 用户的秘书经营技能表
 */
package com.motu.monstercity.server.game.userdata;

import com.motu.monstercity.protocol.Common.PBUserData;
import com.motu.monstercity.server.game.commondata.secretary.SecretaryPotentialSkill;
import com.motu.monstercity.server.game.logic.SecretaryManager;
import com.motu.monstercity.server.game.logic.WorldManager;

public class UserSecretaryBusiness extends UserSecretaryBusinessModel {
    public UserSecretaryBusiness() {
        super();
    }

    public UserSecretaryBusiness(long userId, int secrId, SecretaryPotentialSkill secretaryPotentialSkill) {
        super();
        putUniqueId(SecretaryManager.getBusinessUnique(userId, secrId));
        putSkillId(secretaryPotentialSkill.getId());
        putSecretaryId(secrId);
    }

    // 增量更新
    public void addValue(PBUserData.Builder pbUserData, UserInfo userInfo, UserPower userPower, UserSecretary userSecretary, int charType, int addValue) {
        if (addValue == 0) {
            return;
        }
        super.addValue(addValue);
        userSecretary.updateBusinessValue(charType, addValue);//  增量更新
        userPower.updateEarnSecrPer(charType, addValue);// 增量更新
    }
}
